//
//  MessageMainViewController.m
//  BanBanApp
//
//  Created by 副团长 on 16/7/6.
//  Copyright © 2016年 时伟平. All rights reserved.
//

#import "MessageMainViewController.h"

#import "MessageCell.h"

@interface MessageMainViewController ()<UITableViewDelegate,UITableViewDataSource>
@property(nonatomic,strong)UITableView *messageTableView;

@end

static NSString *identifiter = @"MessageCell";

@implementation MessageMainViewController
-(UITableView *)messageTableView{
    if (!_messageTableView) {
        _messageTableView = [[UITableView alloc]initWithFrame:self.view.bounds style:(UITableViewStylePlain)];
        _messageTableView.dataSource = self;
        _messageTableView.delegate = self;
        _messageTableView.tableFooterView = [UIView new];
        _messageTableView.rowHeight = FitRealW(72);

    }
    return _messageTableView;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = UIColorFromRGB(0xFAFBFD);

    [self.view addSubview:self.messageTableView];

    [self.messageTableView registerClass:[MessageCell class] forCellReuseIdentifier:identifiter];
    
}


#pragma mark - Table view data source


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 15;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    MessageCell *cell = [tableView dequeueReusableCellWithIdentifier:identifiter forIndexPath:indexPath];
    
    if (cell==nil) {
        cell = [[MessageCell alloc]initWithStyle:(UITableViewCellStyleSubtitle) reuseIdentifier:identifiter];
    }
    cell.selectionStyle = 0;
    cell.portraitImg.image  =[UIImage imageNamed:@"1"];
    cell.themeLabel.text = @"111111";
    cell.contentLabel.text = @"21345678";
    cell.unReadLabel.text = @"99";
    cell.dateLabel.text = @"11.11.11";
    
    
    return cell;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
